package com.operate.api.operate.order.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.github.pagehelper.PageInfo;
import com.operate.api.base.ApiIndex;
import com.operate.api.base.R;
import com.operate.api.base.RestPage;
import com.operate.api.operate.opinion.domain.vo.OpinionSearchVO;
import com.operate.api.operate.opinion.domain.vo.OpinionVO;
import com.operate.api.operate.opinion.service.IOpinionService;
import com.operate.api.operate.order.domain.vo.OrderConsumeSearchVO;
import com.operate.api.operate.order.domain.vo.OrderConsumeVO;
import com.operate.api.operate.order.service.IOrderConsumeService;
import com.operate.api.operate.order.service.impl.OrderConsumeServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api( tags = ApiIndex.OrderConsumeController)
@RequestMapping(value = "/api/operate/consume")
@RestController
@SaCheckLogin
public class OrderConsumeController {


    @Autowired
    private IOrderConsumeService service;

    @ApiOperation(value = "查询订单列表")
    @GetMapping(value = "/list")
    public R<RestPage<List<OrderConsumeVO>>> list(
            @ApiParam(value = "查询参数") @ModelAttribute OrderConsumeSearchVO searchVO) {
        List<OrderConsumeVO> list = service.getList(searchVO);
        RestPage restPage = new RestPage( new PageInfo(list),list);
        return new R(restPage);
    }




}
